Fix(editor): arrow keys navigate the @, / and [[ menus again - #707
Merged
Conversation
… completion keymap
ArditZubaku
force-pushed
the
fix/completion-arrow-keys
branch
from
September 3, 2026 13:10
105bf73 to
6d41889
Compare
adibhanna
added a commit
that referenced
this pull request
Sep 4, 2026
Follow-up to #707 for #739. A reader who searches the manual for "wikilink" found nothing about the picker because both docs surfaces called it "the [[ reference picker" and never said how to move through it; the picker's own footer only mentioned the display-text and exact-path syntax. The in-app manual and the website now call it the wikilink picker, the authoring entry lists the movement keys (arrows, Ctrl+J/K, Ctrl+N/P, Enter, Tab, Esc), and the footer hint leads with them, so the answer is on the surface the moment the picker opens. Claude-Session: https://claude.ai/code/session_015HNdWonTE8g6dPY2SkdsRS
Contributor
|
Merged into the v2.45.0 release branch, thank you. Verified over CDP in the built app with Vim on and off: the arrows move the highlight in the [[ picker, it stays open, Enter inserts, and Esc still closes it without leaving insert mode. This also closes #739, whose reporter hit exactly this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Arrow keys navigate an open completion menu again — the
@date/note suggestions, the/slash menu, the[[reference picker and the callout[!type picker. Before this, ↑/↓ moved the caret instead, and the caret move closed the menu, so the only way to pick an item was Ctrl+N/Ctrl+P.Why it broke
autocompletion({ defaultKeymap: false })skips the stock completion keymap so mac AltGr-style layouts keep theirAlt-`/Alt-icharacters. The filtered replacement (completionKeymapForEditor) was re-added by spreading it into the editor's generalkeymap.of([...]).Upstream mounts that keymap at
Prec.highest. The spread put it at default precedence and last in the array — and CodeMirror runs same-key bindings in array order (buildKeymappushes ontobinding.run). SodefaultKeymap'sArrowUp/ArrowDown(cursorLineUp/cursorLineDown) ran first, returnedtrue, and the completion never saw the key.EditorPaneandPinnedReferencePanespread it last, so they were broken.QuickCaptureAppandTemplateEditorModalhappened to spread it first, so they worked — which is why the behaviour differed between the main editor and the Quick Note window.The fix
A new
completionKeymapExtensionmounts the same filtered bindings atPrec.highest, matching what@codemirror/autocompletedoes for its own keymap. All four editors mount it next tocompletionNavKeymapinstead of inlining the spread, which removes the ordering trap for future edits.No behaviour change for the AltGr fix — the two mac chords stay filtered out.
Testing
cm-completion-nav-arrows.test.ts: ↓↓↑ moves the highlighted option, the menu stays open and the caret does not move; with no menu open the arrows fall through to the next binding.npm run typecheck,npm run test:run(1827 passed) andnpm run buildall pass locally on Node 22.Before / After
Before — ↓ moves the caret and the
@menu closes.before.mov
After — ↓/↑ move the highlighted item, the menu stays open.
after.mov